import request from "@/utils/request.js";
import {isDev} from "@/setting.js";

const UrlPrefix=isDev ? "/Qilin" : "";

// P职级晋升调整总表查询接口
export function getPromotionData(params){
    return request({
        url:UrlPrefix+"/jeecg-boot/rank/queryTotalRank",
        method:"post",
        data:params
    });
}

// 资质积分查询接口
export function getQualificationsData(params){
    return request({
        url:UrlPrefix+"/jeecg-boot/rank/queryCertificateRank",
        method:"post",
        data:params
    });
}

// 绩效积分查询接口
export function getAchievementsData(params){
    return request({
        url:UrlPrefix+"/jeecg-boot/rank/queryPerformanceRank",
        method:"post",
        data:params
    });
}

// 创新积分查询接口
export function getInnovateData(params){
    return request({
        url:UrlPrefix+"/jeecg-boot/rank/queryInnovateRank",
        method:"post",
        data:params
    });
}

// 贡献积分查询接口
export function getContributionData(params){
    return request({
        url:UrlPrefix+"/jeecg-boot/rank/queryContributionRank",
        method:"post",
        data:params
    });
}

// 添加/编辑资质积分接口
export function insertQualificationsData(params){
    return request({
        url:UrlPrefix+"/jeecg-boot/rank/addCertificateRank",
        method:"post",
        data:params
    });
}

// 导入excel文档接口
export function importExcelData(params){
    return request({
        url:UrlPrefix+"/jeecg-boot/rank/importExcel",
        method:"post",
        data:params
    });
}

// p职级总表导出接口
export function exportExcelPromotionData(params){
    return request({
        url:UrlPrefix+"/jeecg-boot/rank/exportTotalRank",
        method:"post",
        responseType:"blob",
        data:params
    });
}

// 绩效积分导出接口
export function exportExcelAchievementsData(params){
    return request({
        url:UrlPrefix+"/jeecg-boot/rank/exportPerformanceRank",
        method:"post",
        responseType:"blob",
        data:params
    });
}

// 资质积分导出接口
export function exportExcelQualificationsData(params){
    return request({
        url:UrlPrefix+"/jeecg-boot/rank/exportCertificateRank",
        method:"post",
        responseType:"blob",
        data:params
    });
}

// 创新积分导出接口
export function exportExcelInnovateData(params){
    return request({
        url:UrlPrefix+"/jeecg-boot/rank/exportInnovateRank",
        method:"post",
        responseType:"blob",
        data:params
    });
}

// 贡献积分导出接口
export function exportExcelContributionData(params){
    return request({
        url:UrlPrefix+"/jeecg-boot/rank/exportContributionRank",
        method:"post",
        responseType:"blob",
        data:params
    });
}

// 根据当前token获取用户接口
export function getUserInfoByToken(params){
    return request({
        url:UrlPrefix+"/jeecg-boot/base/userInfo",
        method:"post",
        data:params
    });
}

// 根据部门名获取用户接口
export function getEmployeeData(params){
    return request({
        url:UrlPrefix+"/jeecg-boot/rank/queryBasicEmployee",
        method:"post",
        data:params
    });
}

// 编辑P职级晋升调整接口
export function updatePromotionData(params){
    return request({
        url:UrlPrefix+"/jeecg-boot/rank/addTotalRank",
        method:"post",
        data:params
    });
}

// 添加贡献积分接口
export function insertContributionData(params){
    return request({
        url:UrlPrefix+"/jeecg-boot/rank/addContributionRank",
        method:"post",
        data:params
    });
}

// 同步用户信息接口
export function syncUserInfoData(){
    return request({
        url:UrlPrefix+"/jeecg-boot/base/synUser",
        method:"get"
    });
}

// 添加创新积分接口
export function innovateData(params){
    return request({
        url:UrlPrefix+"/jeecg-boot/rank/addInnovateRank",
        method:"post",
        data:params
    });
}
